Connection object. For connecting to databases, and executing queries.
Located in /adodb/adodb.inc.php (line 126)
| Class | Description |
|---|---|
| Connection object. For connecting to databases, and executing queries. | |
| Connection object. For connecting to databases, and executing queries. | |
| ADODB_csv | Connection object. For connecting to databases, and executing queries. |
| ADODB_odbc | Connection object. For connecting to databases, and executing queries. |
Constructor
Begin a Transaction. Must be followed by CommitTrans() or RollbackTrans().
not used - will probably remove in future
Execute SQL, caching recordsets.
Will select the supplied $page number from a recordset, given that it is paginated in pages of $nrows rows per page. It also saves two boolean values saying if the given page is the first and/or last one of the recordset. Added by Iván Oliva to provide recordset pagination.
Will select, getting rows from $offset (1-based), for $nrows.
This simulates the MySQL "select * from table limit $offset,$nrows" , and the PostgreSQL "select * from table limit $nrows offset $offset". Note that MySQL and PostgreSQL parameter ordering is the opposite of the other. eg. CacheSelectLimit(15,'select * from table',3); will return rows 1 to 3 (1-based) CacheSelectLimit(15,'select * from table',3,2); will return rows 3 to 5 (1-based)
BUG: Currently CacheSelectLimit fails with $sql with LIMIT or TOP clause already set
Close Connection
If database does not support transactions, always return true as data always commited
Different SQL databases used different methods to combine strings together.
This function provides a wrapper.
variable number of string parameters
Usage: $db->Concat($str1,$str2);
Connect to database
Converts a date "d" to a string that the database can understand.
Converts a timestamp "ts" to a string that the database can understand.
PEAR DB Compat - do not use internally
PEAR DB Compat - do not use internally.
Execute SQL
Generates a sequence id and stores it in $this->genID; GenID is only available if $this->hasGenID = true;
Return all rows. Compat with PEAR DB
Generates an Insert Query based on an existing recordset.
$arrFields is an associative array of fields with the value that should be assigned.
Note: This function should only be used on a recordset that is run against a single table.
Return first element of first row of sql statement. Recordset is disposed for you.
Return one row of sql statement. Recordset is disposed for you.
Generates an Update Query based on an existing recordset.
$arrFields is an associative array of fields with the value that should be assigned.
Note: This function should only be used on a recordset that is run against a single table.
"Jonathan Younger" <jyounger@unilab.com>
PEAR DB Compat - do not use internally
List columns names in a table as an array.
List columns in a database as an array of ADOFieldObjects.
See top of file for definition of object.
return the databases that the driver can connect to.
Some databases will return an empty array.
PEAR DB Compat - do not use internally.
Will select the supplied $page number from a recordset, given that it is paginated in pages of $nrows rows per page. It also saves two boolean values saying if the given page is the first and/or last one of the recordset. Added by Iván Oliva to provide recordset pagination.
See readme.htm#ex8 for an example of usage.
Establish persistent connect to database
Portable Insert ID. Pablo Roca <pabloroca@mvps.org>
Should prepare the sql statement and return the stmt resource.
For databases that do not support this, we return the $sql. To ensure compatibility with databases that do not support prepare:
$stmt = $db->Prepare("insert into table (id, name) values (?,?)"); $db->Execute($stmt,array(1,'Jill')) or die('insert failed'); $db->Execute($stmt,array(2,'Joe')) or die('insert failed');
Converts a timestamp "ts" to a string that the database can understand.
An example is $db->qstr("Don't bother",magic_quotes_runtime());
PEAR DB Compat - do not use internally.
PEAR DB Compat - do not use internally.
If database does not support transactions, rollbacks always fail, so return false
Lock a row, will escalate and lock the table if row locking not supported will normally free the lock at the end of the transaction
Choose a database to connect to. Many databases do not support this.
Will select, getting rows from $offset (1-based), for $nrows.
This simulates the MySQL "select * from table limit $offset,$nrows" , and the PostgreSQL "select * from table limit $nrows offset $offset". Note that MySQL and PostgreSQL parameter ordering is the opposite of the other. eg. SelectLimit('select * from table',3); will return rows 1 to 3 (1-based) SelectLimit('select * from table',3,2); will return rows 3 to 5 (1-based)
Uses SELECT TOP for Microsoft databases (when $this->hasTop is set) BUG: Currently SelectLimit fails with $sql with LIMIT or TOP clause already set
PEAR DB Compat - do not use internally.
The fetch modes for NUMERIC and ASSOC for PEAR DB and ADODB are identical for easy porting :-)
Usage: UpdateBlob('TABLE', 'COLUMN', $var, 'ID=1', 'BLOB');
$blobtype supports 'BLOB' and 'CLOB'
$conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)'); $conn->UpdateBlob('blobtable','blobcol',$blob,'id=1');
Usage: UpdateBlob('TABLE', 'COLUMN', '/path/to/file', 'ID=1', 'BLOB');
$blobtype supports 'BLOB' and 'CLOB'
$conn->Execute('INSERT INTO blobtable (id, blobcol) VALUES (1, null)'); $conn->UpdateBlob('blobtable','blobcol',$blobpath,'id=1');
Usage: UpdateClob('TABLE', 'COLUMN', $var, 'ID=1', 'CLOB');
$conn->Execute('INSERT INTO clobtable (id, clobcol) VALUES (1, null)'); $conn->UpdateClob('clobtable','clobcol',$clob,'id=1');
Convert recordset to an array recordset input recordset's cursor should be at beginning, and old $rs will be closed.
Documentation generated on Thu, 04 Sep 2008 16:14:45 +0400 by phpDocumentor 1.3.0RC3